package com.generator.utils;
import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.StrUtil;

import javax.servlet.http.HttpServletRequest;


/**
 * @version 1.0
 * @Author Xing
 * @Date 2023/12/6 18:20
 */
public class TokenUtils {
    public static String generator(){
        return UUID.fastUUID().toString(true);
    }
    public static String getAccesstoken(HttpServletRequest request){
        String authorization = request.getHeader("Authorization");
        System.out.println(authorization);
        if (StrUtil.isBlank(authorization)){
            authorization = request.getParameter("token");
        }
        return authorization;
    }
}
